<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@include file="includes/import.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>

<script type="text/javascript" src="<%=basePathHeader%>/JAVAScripts/common/date.js"></script>
<script type="text/javascript" src="<%=basePathHeader%>/JAVAScripts/common/formValidator-4.1.1.js"></script>
<script type="text/javascript" src="<%=basePathHeader%>/JAVAScripts/common/formValidatorRegex.js"></script>
	<link rel="stylesheet" href="<%=basePathHeader%>/styles/register.css"
			type="text/css" />

<script type="text/javascript" language="javascript">
$(document).ready(function(){
	$.formValidator.initConfig({theme:"126",submitOnce:true,formID:"userRegister",
		onError:function(msg){},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#email").formValidator({onShowFixText:"",onShow:"请输入邮箱",onFocus:"",onCorrect:"此邮箱可用",defaultValue:""}).inputValidator({min:0,max:200,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"}).ajaxValidator({
		dataType : "json",
		async : true,
		url : "<%=basePathHeader %>/checkEmail.htm",
		success : function(data){
			return true;
		},
		buttons: $("#button"),
		error: function(jqXHR, textStatus, errorThrown){return false;},
		onError : "该邮箱不可用，请更换邮箱",
		onWait : "正在进行合法性校验，请稍候..."
	});
	$("#nickname").formValidator({onShowFixText:"",onShow:"",onCorrect:"该昵称可以注册",defaultValue:""}).inputValidator({min:6,max:12,onError:"你输入的昵称长度不正确,请确认"}).regexValidator({regExp:"username",dataType:"enum",onError:"昵称格式不正确"})
	    .ajaxValidator({
		dataType : "json",
		async : true,
		url : "<%=basePathHeader %>/checkUser.htm",
		success : function(data){
			return true;
		},
		buttons: $("#button"),
		error: function(jqXHR, textStatus, errorThrown){return false;},
		onError : "该昵称不可用，请更换昵称",
		onWait : "正在进行合法性校验，请稍候..."
	});
	$("#password").formValidator({onShowFixText:"",onShow:"请输入密码",onFocus:"至少1个长度",onCorrect:"密码合法"}).inputValidator({min:6,max:16,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码长度错误,请确认"}).passwordValidator({compareID:"us"});
	$("#password2").formValidator({onShowFixText:"请再次输入密码",onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"密码一致"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password",operateor:"=",onError:"2次密码不一致,请确认"});
	$("#county").formValidator({onShow:"请选择所在区",onFocus:"所在区必须选择",onCorrect:"",defaultValue:""}).inputValidator({min:1,onError: "请选择所在区"}).defaultPassed();
	$("#YYYY").formValidator({onShow:"请选择您出生年份",onFocus:"您出生年份必须选择",onCorrect:"",defaultValue:""}).inputValidator({min:1,onError: "请选择您出生年份"}).defaultPassed();
	$("#MM").formValidator({onShow:"请选择您出生月份",onFocus:"您出生月份必须选择",onCorrect:"",defaultValue:""}).inputValidator({min:1,onError: "请选择您出生月份"}).defaultPassed();
	$("#DD").formValidator({onShow:"请选择出生日期",onFocus:"出生日期必须选择",onCorrect:"",defaultValue:""}).inputValidator({min:1,onError: "请选择出生日期"}).defaultPassed();
	$("#emailTip").attr("class", "reg_note font_red").html("");
	$("#passwordTip").html("");
	$("#sexTip").html("");
	$("#countyTip").css("float","right");
	$("#YYYYTip").html("");
	$("#MMTip").html("");
	$("#DDTip").html("");
});

function userRegiste() {
	$("#userRegister").submit();
}
</script>
</head>
<body >
<c:import url="includes/header.jsp" />
<div class="content clearfix">
		     <div class="reg_user"><h3>注册聚哪儿网会员</h3></div>	
				 	
				 <form id="userRegister" action="<%=basePathHeader %>/register.htm" method="post">		 
				       <div class="reg_user">
				       <label>邮箱地址：</label>
				 			 <div class="reg_useright">
							 <input type="text" id="email" name="email" />
							 <span id="emailTip" class="reg_note col_999"></span>
							 </div>
							 <div class="clear"></div>
							 </div>
				       <div class="reg_user">
				       <label>昵称：</label>
							 <div class="reg_useright">
				 			 <input type="text" id="nickname" name="nickname" class="g-ipt"/>  
				 			 <span id="nicknameTip" class="reg_note col_999"></span><br />
				 			 <p class="reg_note col_999">密码长度只能在6-12个字符</p>
							 </div>
							 <div class="clear"></div>
							 </div>
							 
				       <div class="reg_user">
				       <label>密码：</label>
							 <div class="reg_useright">
				 			 <input type="password" id="password" name="password" />
				 			 <span id="passwordTip" class="reg_note col_999"></span>
							 </div>
							 <div class="clear"></div>
							 </div>
							 
				       <div class="reg_user">
				       <label>确认密码：</label>
							 <div class="reg_useright">
				 			 <input type="password" id="password2" name="password2" />
				 			 <span id="password2Tip" class="reg_note col_999"></span>
							 </div>
							 <div class="clear"></div>
							 </div>
							 
				       <div class="reg_user">
				       <label>性别：</label>
							 <div class="reg_useright">
							 <input name="sex" type="radio" value="男" checked="checked"><span>男</span></input><input name="sex" type="radio" value="女"><span>女</span></input><br />
							 <span id="sexTip" class="reg_note col_999"></span>
							 </div>
							 <div class="clear"></div>
							 </div>
							 
				       <div class="reg_user">
				       <label>所在地：</label>
							 <div class="reg_useright">
							 <input type="hidden" name="province" value="北京市"/>
							<input type="hidden" name="city" value="北京市"/>
							<select name="city1" disabled="disabled">
								<option value="北京市">北京市</option>
							</select>
							 &nbsp;
							 <select id="county" name="county" style="width: 120px;">
								<option value="">请选择所在区</option>
							 	<option value="东城区">东城区</option>
							 	<option value="西城区">西城区</option>
							 	<option value="崇文区">崇文区</option>
							 	<option value="宣武区">宣武区</option>
							 	<option value="朝阳区">朝阳区</option>
							 	<option value="丰台区">丰台区</option>
							 	<option value="石景山区">石景山区</option>
							 	<option value="海淀区">海淀区</option>
							 	<option value="门头沟区">门头沟区</option>
							 	<option value="房山区">房山区</option>
							 	<option value="通州区">通州区</option>
							 	<option value="顺义区">顺义区</option>
							 	<option value="昌平区">昌平区</option>
							 	<option value="大兴区">大兴区</option>
							 	<option value="怀柔区">怀柔区</option>
							 	<option value="平谷区">平谷区</option>
							 	<option value="密云县">密云县</option>
							 	<option value="延庆县">延庆县</option>
							 	<option value="延庆镇">延庆镇</option>
							</select>
							 <span id="countyTip" class="reg_note col_999"></span>
							 </div> 
							 <div class="clear"></div>
							 </div>
							 
				       <div class="reg_user">
				       		<label>生日：</label>
							<div class="reg_useright">
								<select id="YYYY" name="YYYY"><option value="">请选择</option></select> 年
								<select id="MM" name="MM"><option value="">请选择</option></select> 月
								<select id="DD" name="DD"><option value="">请选择</option></select> 日
								<span id="YYYYTip" class="reg_note col_999"></span>
								<span id="MMTip" class="reg_note col_999"></span>
								<span id="DDTip" class="reg_note col_999"></span>
							</div> 
							<div class="clear"></div>
					   </div>
							 <span class="reg_infobtn" onclick="userRegiste()"></span>
				 </form>
</div>


	<c:import url="includes/footer.jsp" />
</body>
</html>
